package com.kakaxi.mybilibili.module.home.category.view;

import android.os.Bundle;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.RecyclerView;
import android.view.ViewGroup;

import com.kakaxi.mybilibili.R;
import com.kakaxi.mybilibili.base.BaseFragment;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 分类区域子碎片类
 * Created by kakaxi on 16/11/28.
 */

public class CategoryAreaChildFragment extends BaseFragment {

    @BindView(R.id.recv_common_fragment)
    RecyclerView recyclerView;

    @BindView(R.id.srl_common_fragment)
    SwipeRefreshLayout swipeRefreshLayout;

    /** 区名参数 **/
    private static final String PARAM_TYPENAME = "typename";
    /** 区id参数 **/
    private static final String PARAM_TID = "tid";

    /** 区名 **/
    private String mTypename;
    /** 区id **/
    private int mTid;

    public static CategoryAreaChildFragment newInstance(String typename, int tid) {
        CategoryAreaChildFragment categoryAreaChildFragment = new CategoryAreaChildFragment();
        categoryAreaChildFragment.setTitle(typename);

        Bundle bundle = new Bundle();
        bundle.putString(PARAM_TYPENAME, typename);
        bundle.putInt(PARAM_TID, tid);
        categoryAreaChildFragment.setArguments(bundle);
        return categoryAreaChildFragment;
    }

    @Override
    protected int getContentViewId() {
        return R.layout.fragment_common_recycler;
    }

    @Override
    protected void setupViews(ViewGroup viewGroup) {
        ButterKnife.bind(this, viewGroup);
    }

    @Override
    protected void initData() {
        Bundle bundle = getArguments();
        mTypename = bundle.getString(PARAM_TYPENAME);
        mTid = bundle.getInt(PARAM_TID);
    }
}
